package com.yikome.storehouse.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.yikome.common.CommonRepository;
import com.yikome.storehouse.entity.Inventory;

@Repository
public interface InventoryRepository extends CommonRepository<Inventory, Long> {

	@Query("select t from Inventory t where t.yn = 1 and t.storehouseId = :storehouseId and t.productSkuBarcode = :productSkuBarcode")
	Inventory findInventory(@Param("storehouseId")Long storehouseId, @Param("productSkuBarcode")String productSkuBarcode);

	@Query("select t from Inventory t where t.yn = 1 and t.productSkuBarcode = :productSkuBarcode")
	List<Inventory> findInventory(@Param("productSkuBarcode")String productSkuBarcode);
}
